#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n = 0;
    cin >> n;

    int mi = 0, mx = 2e9;

    for (int i = 0;i < n;i++)
    {
        int a, b;
        cin >> a >> b;
        mi = max(mi, a / (b + 1) + 1);
        mx = min(mx, a / b);
    }

    cout << mi << " " << mx << endl;

    return 0;
}